<template>
    <view class="topbar">

        <view class="fullTelMask " :class="{'show':isShow}"></view>
        <view class="home-user" :class="{'show':isShow}">
            <view class='hold-img-box'>
                <view class="tit"><text>备注</text></view>
                <view class="content">

                    <textarea confirm-type="done" v-model="remarkVal" maxlength="300" placeholder="请输入" @confirm="fininsh"></textarea>
	
                </view>
                <view class="btnBox">
                    <button class="openBtn" style="width:160px;height: 90rpx;line-height:90rpx;font-size: 30rpx; background-color: transparent; " @click="close">取消</button>
                    <button class="openBtn" style="width:160px;height: 90rpx;line-height:90rpx;font-size: 30rpx; background-color: transparent; color: #1587fa; " @click="fininsh">确定</button>
                </view>
            </view>

        </view>

    </view>

</template>
<script>
const app = getApp();
export default {
    props: [ 'isShow','msg'],
    components: {},
    data () {
        return {
           

            remarkVal:''
        }
    },
    watch:{
        isShow(current ){

            if(current){
                this.remarkVal = this.msg
            }
        }

    },
    methods: {
        fininsh () {

            // // 判断是否含有emoji表情
            // let iconRule = /[\uD83C|\uD83D|\uD83E][\uDC00-\uDFFF][\u200D|\uFE0F]|[\uD83C|\uD83D|\uD83E][\uDC00-\uDFFF]|[0-9|*|#]\uFE0F\u20E3|[0-9|#]\u20E3|[\u203C-\u3299]\uFE0F\u200D|[\u203C-\u3299]\uFE0F|[\u2122-\u2B55]|\u303D|[\A9|\AE]\u3030|\uA9|\uAE|\u3030/ig
            // // 如果为true，字符串含有emoji表情 ，false不含
            // if (iconRule.test(this.remarkVal)) {

            //     uni.showToast({title:'不支持特殊字符、表情图',icon:'none'})

            //     this.remarkVal = this.remarkVal.replace(iconRule, '')
            //     return
            // }


            this.$emit('finish', this.remarkVal)

            this.close()

        },
        close () {
           
            this.$emit('update:isShow',false)

        },
    }
}
</script>

<style scoped lang="scss">
.fullTelMask {
    /* background:#ffffff; */
    position: fixed;
    z-index: 50;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    // -webkit-backdrop-filter: blur(2px);
    // backdrop-filter: blur(2px);
    display: none;
}
.fullTelMask.show {
    display: block;
}
.home-user {
    position: fixed;
    /* height: 360rpx; */
    background-color: #fff;
    z-index: 52;
    top: 20%;
    left: 50%;
    transform: translate(-50%, 0%);
    border-radius: 14rpx;
    display: none;
}
.home-user.show {
    display: block;
}

.hold-img-box {
    width: 100%;
    position: relative;
    text-align: center;
    border-radius: 6px;
    overflow: hidden;
    margin: 30rpx 0 0rpx;
    box-sizing: border-box;
    padding: 0;
}

.hold-img-box .tit {
    color: #000;
    font-weight: bold;
    text-align: center;
    /* margin-top: 20rpx; */
    font-size: 32rpx;
    padding: 30rpx 50rpx;
}
.hold-img-box .content {
    padding: 10rpx 0 30rpx 0;
    text-align: left;
    textarea{
        margin: 0 30rpx;
        border: 1rpx solid #f1f1f1;
        padding: 24rpx;
        border-radius: 6px;
        font-size: 26rpx;
        height: 80px;
        background: #fafafa;
    }
}

.hold-img-box .h1 {
    color: #777777;
    text-align: center;
    font-size: 28rpx;
}
.btnBox {
    position: relative;
    margin-top: 20px;
    display: flex;
    border-top: 1rpx solid #f1f1f1;
    /* background-color: #f1f1f1; */
    button::after{
        border: none;
    }
}
.btnBox::after {
    position: absolute;
    left: 50%;
    content: " ";
    width: 1px;
    height: 100%;
    background-color: #f1f1f1;
}
.btnBox .openBtn {
    flex: 1;
}
.openBtn {
    padding: 0;
    height: 60rpx;
    line-height: 60rpx;
    text-align: center;
    font-size: 26rpx;
    background-color: #1587fa;
    margin: 0;
    color: #000;
}

.niIpt {
    /* width: 100%; */
    display: flex;
    margin-top: 30rpx;
    align-items: center;
    padding: 0 40rpx;
    box-sizing: border-box;
    background-color: #f1f1f1;
    height: 70rpx;
    border-radius: 70rpx;
    margin: 30rpx 110rpx 0;
}
.niIpt input {
    flex: 1;
    text-align: center;
    padding: 0 30rpx;
    box-sizing: border-box;
    font-size: 32rpx;

    /* border-bottom: 1px solid; */
}
</style>
